<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/


Route::group(['prefix'=>'Service/Login' ,'middleware' => ['web'], 'namespace'=>'Service'], function () {
    Route::any('login','LoginController@login');
    Route::any('verifyCode{num?}','LoginController@VerifyCode');
    Route::any('register','LoginController@register');
    Route::any('sendSMS','LoginController@sendSMS');
    Route::any('test','LoginController@test');
});


Route::group(['prefix'=>'Service/Category' ,'middleware' => ['web'], 'namespace'=>'Service'], function () {
    Route::any('getCategories','CategoryController@getCategories');

});

Route::group(['prefix'=>'Service/Product' ,'middleware' => ['web'], 'namespace'=>'Service'], function () {
    Route::get('getProducts/{cateId}','ProductController@getProducts');
    Route::get('getProductInfo/{pmiId}','ProductController@getProductInfo');

});

Route::group(['prefix'=>'Service/Car' ,'middleware' => ['web'], 'namespace'=>'Service'], function () {
    Route::post('addProduct','CarController@addProduct');

});
